package com.songjia.springcloud.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import com.songjia.common.model.base.ResponseInfo;
import com.songjia.common.service.DeptClientService;

@RestController
public class DeptController {

	// 直接面向接口编程
	@Autowired
	private DeptClientService deptClientService;

	@GetMapping("/dept/{id}")
	public ResponseInfo get(@PathVariable("id") Long id) {
		return this.deptClientService.get(id);
	}

	@GetMapping("/depts")
	public ResponseInfo getAll() {
		return this.deptClientService.getAll();
	}
}